import java.util.Arrays;


public class Text {
    public static void main(String[] args) throws CloneNotSupportedException {
        Student student = new Student("Kate",22,100);
        Student student1 = (Student)student.clone();
        System.out.println(student.m.money);
        System.out.println(student1.m.money);
        System.out.println("===============================");
        student1.m.money = 66.66;
        System.out.println(student.m.money);
        System.out.println(student1.m.money);
        System.out.println("===============================");
        student.m.money = 77.77;
        System.out.println(student.m.money);
        System.out.println(student1.m.money);
    }
    public static void main3(String[] args) throws CloneNotSupportedException {
        Student student = new Student("nini",32,99);
        //父类对象给子类引用，发生向下转型，需要强制类型转换一下：
        Student student1 = (Student)student.clone();
        System.out.println(student);
        System.out.println(student1);
    }

    public static void main2(String[] args) {
        Student[] stu = new Student[3];
        stu[0] = new Student("Liu六大顺",18,88);
        stu[1] = new Student("Qi星高照",22,98);
        stu[2] = new Student("San羊开泰",19,100);


        //有了compareTo 这个方法，也可以使用 sort 这个方法来进行排序
         Arrays.sort(stu);
         System.out.println(Arrays.toString(stu));
    }
    public static void drawMap(Shape shape){
        shape.draw();
    }
    public static void main1(String[] args) {
        Circle circle = new Circle();
        Triangle triangle = new Triangle();
        Star star = new Star();

        Shape[] shapes = {circle,star,triangle,star};
        for (Shape shape:shapes) {
            shape.draw();
        }
    }
}
